<template>
    <div>
        <Button type='error' @click="requestNoAccess">权限请求测试</Button>
        <Button type="info" v-has='[ifShow]'>我是按钮权限控制</Button>
        <h1>角色管理</h1>
    </div>
</template>

<script>
import role from '@/api/signin'
export default {
  data () {
    return {
      ifShow: role.noAccess
    }
  },
  created () {
    console.log(role.noAccess)
  },
  methods: {
    async requestNoAccess () {
      try {
        let result = await role.noAccess.r({access: 1})
        this.$Message.success(`此用户有权限发送请求 ${JSON.stringify(result.data)}`)
      } catch (error) {
        this.$Message.error(error)
      }
    }
  }
}
</script>
